package mutsumimod.monsters;

import basemod.abstracts.CustomMonster;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.animations.VFXAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.powers.AbstractPower;
import com.megacrit.cardcrawl.relics.AbstractRelic;
import com.megacrit.cardcrawl.vfx.AbstractGameEffect;
import com.megacrit.cardcrawl.vfx.combat.BlockedWordEffect;
import com.megacrit.cardcrawl.vfx.combat.DeckPoofEffect;
import com.megacrit.cardcrawl.vfx.combat.HbBlockBrokenEffect;
import com.megacrit.cardcrawl.vfx.combat.StrikeEffect;

import java.util.Iterator;

public abstract class BaseMonster extends CustomMonster {

    public String imgUrl;

    public BaseMonster(String name, String id, int maxHealth, float hb_x, float hb_y, float hb_w, float hb_h, String imgUrl, float offsetX, float offsetY) {
        super(name, id, maxHealth, hb_x, hb_y, hb_w, hb_h, imgUrl, offsetX, offsetY);
        this.imgUrl = imgUrl;
    }

    public void setHpOut(int hp){
        setHp(hp);
    }

    public void setImgUrl(Texture img){
        this.img=img;
    }

    @Override
    public abstract void takeTurn();

    @Override
    protected abstract void getMove(int i);

    public void damagePlayer(AbstractCreature target, int damageIndex, int times, AbstractGameAction.AttackEffect effect, AbstractGameEffect vfx) {
        for (int i = 0; i < times; i++) {
            addToBot(new VFXAction(vfx));
            addToBot(new DamageAction(target, this.damage.get(damageIndex), effect));
        }
    }

    public void damagePlayer(AbstractCreature target, int damageIndex, int times, AbstractGameAction.AttackEffect effect) {
        for (int i = 0; i < times; i++) {
            addToBot(new DamageAction(target, this.damage.get(damageIndex), effect));
        }
    }

    public void damagePlayer(int damageIndex, int times, AbstractGameAction.AttackEffect effect) {
        this.damagePlayer(AbstractDungeon.player, damageIndex, times, effect);
    }

    public void damagePlayer(int damageIndex, int times) {
        this.damagePlayer(AbstractDungeon.player, damageIndex, times, AbstractGameAction.AttackEffect.SLASH_DIAGONAL);
    }

}
